package a.h;

import a.c.d;
import a.c.e;
import a.d.w;
import a.j.eb;
import a.j.fb;
import a.j.g;
import a.j.*;
import a.j.ld;
import a.j.tb;
import a.j.zd;

import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
import java.awt.geom.Rectangle2D;

public class zc
  implements ListCellRenderer, TableCellRenderer
{
  private final DefaultListCellRenderer a = new DefaultListCellRenderer();
  private final DefaultTableCellRenderer b = new DefaultTableCellRenderer();
  private int c;
  private int d;
  public static int e;
  
  public zc()
  {
    this(50, 50);
  }
  
  public zc(int paramInt1, int paramInt2)
  {
    this.d = paramInt2;
    this.c = paramInt1;
  }
  
  public int a()
  {
    return this.c;
  }
  
  public void a(int paramInt)
  {
    this.c = paramInt;
  }
  
  public int b()
  {
    return this.d;
  }
  
  public void b(int paramInt)
  {
    this.d = paramInt;
  }
  
  public Component getListCellRendererComponent(JList paramJList, Object paramObject, int paramInt, boolean paramBoolean1, boolean paramBoolean2)
  {
    int i = ec.t;
    boolean bool = ec.s;
    JLabel localJLabel = (JLabel)this.a.getListCellRendererComponent(paramJList, paramObject, paramInt, paramBoolean1, paramBoolean2);
    localJLabel.setText(null);
    if (i == 0) {
      if ((paramObject instanceof ld))
      {
        localJLabel.setIcon(a((ld)paramObject, this.c, this.d));
        if (i != 0) {
          break label179;
        }
        localJLabel.setToolTipText(a((ld)paramObject));
        if (!bool) {
          break label177;
        }
      }
    }
    if (i == 0)
    {
      if ((paramObject instanceof tb))
      {
        localJLabel.setIcon(a((tb)paramObject, this.c, this.d));
        if (i != 0) {
          break label179;
        }
        localJLabel.setToolTipText(a((tb)paramObject));
      }
    }
    else {
      if (!bool) {
        break label177;
      }
    }
    throw new IllegalArgumentException("Can only handle NodeRealizers and EdgeRealizers! " + paramObject.toString());
    label177:
    label179:
    return localJLabel;
  }
  
  public Component getTableCellRendererComponent(JTable paramJTable, Object paramObject, boolean paramBoolean1, boolean paramBoolean2, int paramInt1, int paramInt2)
  {
    int i = ec.t;
    boolean bool = ec.s;
    JLabel localJLabel = (JLabel)this.b.getTableCellRendererComponent(paramJTable, paramObject, paramBoolean1, paramBoolean2, paramInt1, paramInt2);
    localJLabel.setText(null);
    localJLabel.setPreferredSize(new Dimension(this.c, this.d));
    if (i == 0) {
      if ((paramObject instanceof ld))
      {
        localJLabel.setIcon(a((ld)paramObject, this.c, this.d));
        if (i != 0) {
          break label201;
        }
        localJLabel.setToolTipText(a((ld)paramObject));
        if (!bool) {
          break label199;
        }
      }
    }
    if (i == 0)
    {
      if ((paramObject instanceof tb))
      {
        localJLabel.setIcon(a((tb)paramObject, this.c, this.d));
        if (i != 0) {
          break label201;
        }
        localJLabel.setToolTipText(a((tb)paramObject));
      }
    }
    else {
      if (!bool) {
        break label199;
      }
    }
    throw new IllegalArgumentException("Can only handle NodeRealizers and EdgeRealizers! " + paramObject.toString());
    label199:
    label201:
    return localJLabel;
  }
  
  protected Icon a(ld paramld, int paramInt1, int paramInt2)
  {
    return new b_(paramld, paramInt1, paramInt2);
  }
  
  protected Icon a(tb paramtb, int paramInt1, int paramInt2)
  {
    return new a_(paramtb, paramInt1, paramInt2);
  }
  
  protected String a(ld paramld)
  {
    return null;
  }
  
  protected String a(tb paramtb)
  {
    return null;
  }
  
  public static class a_
    implements Icon
  {
    private tb a;
    private boolean b;
    private final int c;
    private final int d;
    public static int e;
    
    public a_(tb paramtb, int paramInt1, int paramInt2)
    {
      this.c = paramInt1;
      this.d = paramInt2;
      this.b = true;
      a(paramtb.e());
    }
    
    public boolean a()
    {
      return this.b;
    }
    
    public void a(boolean paramBoolean)
    {
      this.b = paramBoolean;
    }
    
    private void a(tb paramtb)
    {
      g localg = new g();
      e locale1 = localg.i();
      e locale2 = localg.i();
      d locald = localg.a(locale1, locale2, paramtb.e());
      this.a = localg.t(locald);
      this.a.a(new zd(0.0D, 0.0D));
      this.a.b(new zd(0.0D, 0.0D));
      this.a.s();
      w localw1 = a(this.a, this.c, this.d);
      w localw2 = b(this.a, this.c, this.d);
      this.a.c(localw1.a(), localw1.b());
      this.a.c(localw2.a(), localw2.b());
      localg.w(locale1).b(1.0D, 1.0D);
      localg.w(locale1).d(false);
      localg.w(locale1).c(3.0D, localw1.b());
      localg.w(locale2).b(1.0D, 1.0D);
      localg.w(locale2).d(false);
      localg.w(locale2).c(this.c - 3, localw2.b());
    }
    
    protected w a(tb paramtb, int paramInt1, int paramInt2)
    {
      return new w(0.5D * paramInt1, 0.8D * paramInt2);
    }
    
    protected w b(tb paramtb, int paramInt1, int paramInt2)
    {
      return new w(0.5D * paramInt1, 0.2D * paramInt2);
    }
    
    public int getIconHeight()
    {
      return this.d;
    }
    
    public int getIconWidth()
    {
      return this.c;
    }
    
    public void paintIcon(Component paramComponent, Graphics paramGraphics, int paramInt1, int paramInt2)
    {
      Graphics2D localGraphics2D = (Graphics2D)paramGraphics.create();
      localGraphics2D.translate(paramInt1, paramInt2);
      a(this.a, localGraphics2D);
      localGraphics2D.dispose();
    }
    
    protected void a(tb paramtb, Graphics2D paramGraphics2D)
    {
      paramGraphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
      paramGraphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
      paramtb.S();
      a(paramGraphics2D);
      paramtb.c(false);
      paramtb.c(paramGraphics2D);
    }
    
    private void a(Graphics2D paramGraphics2D)
    {
      int i = ec.t;
      boolean bool = ec.s;
      if ((i != 0) || ((a()) && ((i != 0) || (this.a.n() > 0))))
      {
        fb localfb = this.a.o();
        do
        {
          if (!localfb.e()) {
            break;
          }
          eb localeb = localfb.a();
          paramGraphics2D.setColor(Color.green);
          Ellipse2D.Double localDouble = new Ellipse2D.Double(localeb.b() - 3.0D, localeb.c() - 3.0D, 6.0D, 6.0D);
          paramGraphics2D.fill(localDouble);
          paramGraphics2D.setColor(Color.darkGray);
          paramGraphics2D.draw(localDouble);
          localfb.f();
        } while (!bool);
      }
    }
  }
  
  public static class b_
    implements Icon
  {
    private ld a;
    private int b;
    private int c;
    private int d;
    private double e;
    private Rectangle2D f;
    public static boolean g;
    
    public b_(ld paramld, int paramInt1, int paramInt2)
    {
      this.b = paramInt1;
      this.c = paramInt2;
      this.a = paramld;
      this.f = paramld.O();
      int i = 0;
      do
      {
        if (i >= paramld.x()) {
          break;
        }
        jg localjg = paramld.b(i);
        localjg.a(this.f);
        i++;
        if ((j == 0) && (bool)) {
          return;
        }
      } while (!bool);
      this.d = Math.max(0, Math.min(4, Math.min(paramInt1 - 4, paramInt2 - 4) / 2));
      if (j == 0) {
        this.e = Math.min(1.0D, Math.min((this.b - this.d) / this.f.getWidth(), (this.c - this.d) / this.f.getHeight()));
      }
    }
    
    public int getIconHeight()
    {
      return this.c;
    }
    
    public int getIconWidth()
    {
      return this.b;
    }
    
    public void paintIcon(Component paramComponent, Graphics paramGraphics, int paramInt1, int paramInt2)
    {
      Graphics2D localGraphics2D = (Graphics2D)paramGraphics.create();
      localGraphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
      localGraphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
      localGraphics2D.translate(paramInt1 + this.d / 2 + (this.b - this.d - this.f.getWidth() * this.e) * 0.5D, paramInt2 + this.d / 2 + (this.c - this.d - this.f.getHeight() * this.e) * 0.5D);
      localGraphics2D.translate(this.f.getWidth() * 0.5D * this.e, this.f.getHeight() * 0.5D * this.e);
      localGraphics2D.scale(this.e, this.e);
      localGraphics2D.translate(-this.f.getCenterX(), -this.f.getCenterY());
      boolean bool = this.a.H();
      try
      {
        this.a.e(false);
        this.a.e(localGraphics2D);
      }
      finally
      {
        this.a.e(bool);
      }
      localGraphics2D.dispose();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.zc

 * JD-Core Version:    0.7.0.1

 */